<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="libraryAdministration.*" import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jq/jquery-1.11.1.js"></script>
<style type="text/css">
table.imagetable {
	font-family:arial,sans-serif;
	font-size:18px;
	color:#333333;
	border-width: 1px;
	border-color: #999999;
	border-collapse: collapse;
}
table.imagetable th {
	background:#FFC;
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #999999;
}
table.imagetable td {
	background:#FFF;
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #999999;
}
.imagetable{
	margin-top:10px;
}
</style>
<script type="text/javascript">
	
</script>
</head>
<body>
查询结果:
<form action="TitleInquiryBook" method="get">
<table class="imagetable">
<tr><th>序号</th><th>图书的名称</th><th>作者</th><th>价格</th><th>出版社</th></tr>
<% 
request.setCharacterEncoding("UTF-8");
String bookName=request.getParameter("name");
BookDao dao=new BookDao();
ArrayList<Book> books=dao.getBooks(bookName);//将所选的书的信息存放在books中
int i=0;
for(Book book:books){	//遍历循环books
	i++;
%>
<tr><td><%=i%><input type="hidden" value="<%=book.getId() %>"/></td><td><%=book.getName() %></td><td><%=book.getAuthor() %></td><td><%=book.getPrice() %></td><td><%=book.getPress() %></td></tr>
<%
}
%>
</table>
</form>
</body>
</html>